<%-- 
    Document   : usersList
    Created on : May 21, 2012, 3:07:03 PM
    Author     : ciummo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="/DGestWebServer/css/dgest.css"/>
        <title>Lista Utenti</title>
    </head>

    
    <body>
        <%@ include file="../adminDialogBar.jspf" %>
        
        <div id="subMenu"> <html:link page="/User.do?method=newUser"><img src="/DGestWebServer/images/userAdd.png" alt="Aggiungi Utente" height="50px" width="50px"/></html:link></div>
        
        <h1> Lista Utenti </h1>
        
    <table class="objectList">
                        <thead>
                            <tr>                                
                                <th>UserName</th>
                                <th>Nome</th>
                                <th>Cognome</th>
                                <th>Ruolo</th>
                                <th></th>
                            </tr>
                        </thead>

                        <tbody>

                            <logic:iterate id="user" name="UserActionForm" property="list" indexId="index" >
                                <pg:item>
                                    <tr>
                                                                              
                                        <td><bean:write name="user" property="username"/></td>
                                        <td><bean:write name="user" property="nome"/></td>
                                        <td><bean:write name="user" property="cognome"/></td>
                                        <td><bean:write name="user" property="ruolo"/></td>
                                        
                                        
                                        <td><html:link page="/User.do?method=eraseUser" paramId="username" paramName="user" paramProperty="username"><img src="/DGestWebServer/images/userErase.png" alt="Elimina Utente" height="25px" width="25px"/></html:link>
                                        
                                        
                                        <logic:equal name="user" property="stato" value="0">
                                        
                                        <html:link page="/User.do?method=switchState" paramId="username" paramName="user" paramProperty="username"><img src="/DGestWebServer/images/userActivate.png" alt="Attiva Utente" height="25px" width="25px"/></html:link>
                                        </logic:equal>
                                        
                                        <logic:equal name="user" property="stato" value="1">
                                        
                                        <html:link page="/User.do?method=switchState" paramId="username" paramName="user" paramProperty="username"><img src="/DGestWebServer/images/userDeactivate.png" alt="Disattiva Utente" height="25px" width="25px"/></html:link>
                                        </logic:equal>
                                        
                                        
                                        <html:link page="/User.do?method=userDetails&func=edit" paramId="username" paramName="user" paramProperty="username"><img src="/DGestWebServer/images/userEdit.png" alt="Modifica Utente" height="25px" width="25px"/></html:link>
                                        
                                        <html:link page="/User.do?method=userDetails&func=view" paramId="username" paramName="user" paramProperty="username"><img src="/DGestWebServer/images/userView.png" alt="Visualizza Utente" height="25px" width="25px"/></html:link></td>

                                    </tr>
                                </pg:item>
                            </logic:iterate>

                        </tbody>
                    </table>
    </body>    
    
    
</html>
